package UserInterface;

import java.awt.*;

import javax.swing.*;
import javax.swing.GroupLayout.Alignment;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class MaintananceActionPanel extends JPanel{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private static final int HEIGTH=100; 
	private static final int WIDTH=100;
	
	
	JLabel maintenanceActionLabel = new JLabel("Choose what action do you want to do :");
	private JButton seeBanksBalanceButton = new JButton("See banks balance");
	private JButton setMoneyButton = new JButton("InputMoney");
	private JButton allowUsersButton = new JButton("Allow users mode");
	
	public void addSeeBankBalanceActionListener(ActionListener list){
		seeBanksBalanceButton.addActionListener(list);
	}

	public void addSetMoneyListener(ActionListener list){
		setMoneyButton.addActionListener(list);
	}

	public void addAllowUsersActionListener(ActionListener list){
		allowUsersButton.addActionListener(list);
	}

	MaintananceActionPanel(){
		setBackground(new Color(255, 248, 220));
		
		maintenanceActionLabel.setForeground(new Color(128, 0, 0));
		maintenanceActionLabel.setFont(new Font("Arial", Font.BOLD | Font.ITALIC, 18));
		
		
		this.setSize(500,500);
		
		setMoneyButton.setFont(new Font("Tahoma", Font.BOLD, 12));
		setMoneyButton.setBackground(new Color(240, 240, 240));
		setMoneyButton.setFont(new Font("Tahoma", Font.BOLD, 12));
		
		setMoneyButton.setVisible(true);
		 seeBanksBalanceButton = new JButton("See banks balance");
		seeBanksBalanceButton.setFont(new Font("Tahoma", Font.BOLD, 12));
		
	    allowUsersButton = new JButton("Allow users mode");
		allowUsersButton.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
			}
		});
		allowUsersButton.setFont(new Font("Tahoma", Font.BOLD, 12));
		GroupLayout groupLayout = new GroupLayout(this);
		groupLayout.setHorizontalGroup(
			groupLayout.createParallelGroup(Alignment.LEADING)
				.addGroup(groupLayout.createSequentialGroup()
					.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
						.addGroup(groupLayout.createSequentialGroup()
							.addGap(76)
							.addComponent(maintenanceActionLabel, GroupLayout.PREFERRED_SIZE, 352, GroupLayout.PREFERRED_SIZE))
						.addGroup(groupLayout.createSequentialGroup()
							.addGap(123)
							.addGroup(groupLayout.createParallelGroup(Alignment.TRAILING, false)
								.addComponent(seeBanksBalanceButton, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
								.addComponent(setMoneyButton, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 245, Short.MAX_VALUE)
								.addComponent(allowUsersButton, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
					.addContainerGap(72, Short.MAX_VALUE))
		);
		groupLayout.setVerticalGroup(
			groupLayout.createParallelGroup(Alignment.LEADING)
				.addGroup(groupLayout.createSequentialGroup()
					.addGap(23)
					.addComponent(maintenanceActionLabel, GroupLayout.PREFERRED_SIZE, 40, GroupLayout.PREFERRED_SIZE)
					.addGap(31)
					.addComponent(setMoneyButton, GroupLayout.PREFERRED_SIZE, 41, GroupLayout.PREFERRED_SIZE)
					.addGap(54)
					.addComponent(seeBanksBalanceButton, GroupLayout.PREFERRED_SIZE, 41, GroupLayout.PREFERRED_SIZE)
					.addGap(57)
					.addComponent(allowUsersButton, GroupLayout.PREFERRED_SIZE, 42, GroupLayout.PREFERRED_SIZE)
					.addContainerGap(171, Short.MAX_VALUE))
		);
		setLayout(groupLayout);
		this.setVisible(true);
		
	}
}
